package net.messagenet.mazor.infra.persistence.entities;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 
 * This class represents a product's data in the dpa object
 * each dpa contains many dpa product. each dpa product consists of a real product and adds
 * more information like quantity etc. 
 * 
 * @author Idan
 *
 */
@Entity
@Table(name="MZR_DPA_PRODUCTS")
public class DpaProduct  implements Serializable  {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5771190929085526147L;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY )
	private int id;
	private double sdc;
	private double targetCost;
	private String competitor;
	private double competitorsPrice;
	private int quantity;
	private int quantityReported;
	private int	quantityPaid;
	private double approvedPrice;
	
	@ManyToOne
	private Product product;


	@ManyToOne
	private Dpa dpa;

	
	/**
	 * returns the id of the dpa product in the system
	 * 
	 * @return id
	 */
	
	public int getId() {
		return id;
	}

	/**
	 * sets the id of the dpa product
	 * 
	 * @param id
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * returns the dpa of which this products contained in.
	 * 
	 * @return dpa
	 */
	public Dpa getDpa() {
		return dpa;
	}
	/**
	 * set the dpa of which this products contained in.
	 * 
	 * @param dpa
	 */
	public void setDpa(Dpa dpa) {
		this.dpa = dpa;
	}


	/**
	 * returns the sdc for the product
	 * 
	 * @return sdc
	 */
	public double getSdc() {
		return sdc;
	}

	/**
	 * set the sdc for the product
	 * 
	 * @param sdc
	 */
	public void setSdc(double sdc) {
		this.sdc = sdc;
	}

	/**
	 * returns the target cost for the product
	 * 
	 * @return target cost
	 */
	public double getTargetCost() {
		return targetCost;
	}
	/**
	 * sets the target cost for the product
	 * 
	 * @param targetCost
	 */

	public void setTargetCost(double targetCost) {
		this.targetCost = targetCost;
	}
	/**
	 * returns the Competitor for the product
	 * 
	 * @return Competitor
	 */
	
	public String getCompetitor() {
		return competitor;
	}
	/**
	 * sets the competitor for the product
	 * 
	 * @param competitor
	 */
	public void setCompetitor(String competitor) {
		this.competitor = competitor;
	}
	/**
	 * returns the quantity of the product
	 * 
	 * @return quantity
	 */
	
	public int getQuantity() {
		return quantity;
	}
	/**
	 * sets the quantity of the product
	 * 
	 * @param quantity
	 */
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	/**
	 * returns the approved price of the product
	 * 
	 * @return quantity
	 */
	public double getApprovedPrice() {
		return approvedPrice;
	}
	/**
	 * sets the approved price of the product
	 * 
	 * @param approvedPrice
	 */
	public void setApprovedPrice(double approvedPrice) {
		this.approvedPrice = approvedPrice;
	}
	/**
	 * returns the actual the product of this dpa .
	 * 
	 * @return dpa
	 */
	public Product getProduct() {
		return product;
	}

	/**
	 * sets the actual the product of this dpa .
	 * 
	 * @param dpa
	 */
	public void setProduct(Product product) {
		this.product = product;
	}
	/**
	 * returns the quantity reported . the quantity is reported via POS.
	 * 
	 * @return quantityReported
	 */
	public int getQuantityReported() {
		return quantityReported;
	}
	/**
	 * sets the quantity reported . the quantity is reported via POS
	 * 
	 * @param quantityUsed
	 */
	public void setQuantityReported(int quantityUsed) {
		this.quantityReported = quantityUsed;
	}

	/**
	 * sets the quantity that is already paid . the quantity is reported by refunds
	 * 
	 * @param quantityPaid
	 */
	public void setQuantityPaid(int quantityPaid) {
		this.quantityPaid = quantityPaid;
	}
	/**
	 * returns the quantity that is already paid . the quantity is reported by refunds
	 * 
	 * @return quantityReported
	 */
	public int getQuantityPaid() {
		return quantityPaid;
	}

	public void setCompetitorsPrice(double competitorsPrice) {
		this.competitorsPrice = competitorsPrice;
	}

	/**
	 * returns the competitors price of the product
	 * 
	 * @return competitorsPrice
	 */
	
	public double getCompetitorsPrice() {
		return competitorsPrice;
	}
	
}
